<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <h1>The Ajax 01 Page</h1>
    <fieldset>
        <legend>Ajax异步请求</legend>
        <button onclick="doAjaxGet()">Get Request</button>
        <span id="result">Loading data......</span>
    </fieldset>
</div>

</body>
<script>
    function doAjaxGet(){
        var xhr = new XMLHttpRequest();
        xhr.onreadystatechange=function(){
            if(xhr.readyState==4&&xhr.status==200){
                var result=xhr.responseText;
                document.getElementById("result").innerHTML=result;
            }
        };
        xhr.open("GET","http://localHost:1314/doAjaxGet",true);
        xhr.send();
    };
    function doCheck(){

    }
</script>
</html>